import {createStore,applyMiddleware,combineReducers} from 'redux'
import thunk from 'redux-thunk'
import {reducer as homeReducer} from '../containers/Home/store'

const reducer = combineReducers({
  home:homeReducer
})

export  const getStore = ()=>{
  return createStore(reducer,applyMiddleware(thunk))
}

export  const getClientStore = ()=>{
  const defaultState = window.context.state;  //  注入服务端渲染的store的值给客户端，变成客户端初始的store的值
  return createStore(reducer,defaultState,applyMiddleware(thunk))
}



 getStore